package longcaisuyun.longcai.com.net;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2016/4/6.
 */
@HttpInlet(Net.HISTOIRY)
public class PostHistory extends WHAsyPost {

    public String driverid;
    public String page;
    public PostHistory(String driverid, String page,String code , AsyCallBack asyCallBack) {
        super(asyCallBack);
        this.driverid = driverid;
        this.page = page;
    }

    @Override
    protected Object parser(JSONObject object) {
        Info   info=new Info();

        try {
            info.message= object.getString("message");
            if(object.getString("message").equals("1")){

                info.jsonArray=object.getJSONArray("list");
                info.nextpage=object.getString("nextpage");
                info.ispage=object.getString("ispage");

            }
            return info;
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static class Info {
        public  String   message="";
        public JSONArray   jsonArray;
        public  String    nextpage="";
        public  String    ispage="";
    }
}
